<?php
session_start();
require('zscg.php');
require('local.php');
if(isset($_COOKIE['username'])){
    @$res1=select2($con,'user','where `username`="'.$_COOKIE['username'].'"')[0];  
    $res4=select2($con,'wenzhang','where `uid` = "'.$res1['id'].'"');
}
$sid=isset($_GET['sid'])?'where `fid`="'.$_GET['sid'].'"':'';
$res2=select($con,'wenzhang',$sid,4);
$res5=select2($con,'wenzhang');
$res3=select2($con,'fenlei');
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="">
    <meta name="author" content="">
    
    <title>我的博客</title>
    
    <!-- Bootstrap Core CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css"  type="text/css">
    
    <!-- Owl Carousel Assets -->
    <link href="owl-carousel/owl.carousel.css" rel="stylesheet">
    <link href="owl-carousel/owl.theme.css" rel="stylesheet">
    
    <!-- Custom CSS -->
    <link rel="stylesheet" href="css/style.css">
    
    <!-- Custom Fonts -->
    <link rel="stylesheet" href="font-awesome-4.4.0/css/font-awesome.min.css"  type="text/css">
    
    <!-- jQuery and Modernizr-->
    <script src="js/jquery-2.1.1.js"></script>
    
    <!-- Core JavaScript Files -->       
    <script src="js/bootstrap.min.js"></script>
    
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="js/html5shiv.js"></script>
        <script src="js/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<header>
    <!--Top-->
    <nav id="top">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <strong>欢迎<?php echo isset($res1['nicheng'])?$res1['nicheng']:'登陆我的博客' ?>！</strong>
                </div>
                <div class="col-md-6">
                    <ul class="list-inline top-link link">
                        <li><a href="/home/index.php"><i class="fa fa-home"></i> 首页</a></li>
                        <li><a href="/home/contact.php"><i class="fa fa-comments"></i> 留言</a></li>
                        <li><a href="/index.php"><i class="fa fa-question-circle"></i> 登陆</a></li>
                        <li><a href="./public/logout.php"><i class="fa fa-question-circle"></i> 退出</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>
    
    <!--Navigation-->
    <nav id="menu" class="navbar container">
        <div class="navbar-header">
            <button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button>
            <a class="navbar-brand" href="#">
                <div class="logo"><span>我的博客</span></div>
            </a>
        </div>
        <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav">
                <li><a href="/home/index.php">首页</a></li>
                <!-- <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Account <i class="fa fa-arrow-circle-o-down"></i></a>
                    <div class="dropdown-menu">
                        <div class="dropdown-inner">
                            <ul class="list-unstyled">
                                <li><a href="archive.html">Login</a></li>
                                <li><a href="archive.html">Register</a></li>
                            </ul>
                        </div>
                    </div>
                </li> -->
                <li class="dropdown"><a href="/home/archive.php" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-arrow-circle-o-down">文章</i></a>
                    <div class="dropdown-menu">
                        <div class="dropdown-inner">
                            <ul class="list-unstyled">
                               <?php
                                 foreach($res3 as $v){
                                    echo '<li><a href="/home/archive.php?sid='.$v['id'].'">'.$v['leibie'].'</a></li>';
                                 }
                               ?>
                            </ul>
                        </div> 
                    </div>
                </li>
                <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">美图 <i class="fa fa-arrow-circle-o-down"></i></a>
                    <div class="dropdown-menu" style="margin-left: -203.625px;">
                        <div class="dropdown-inner">
                            <ul class="list-unstyled">
                                <li><a href="#">image 301</a></li>
                                <li><a href="#">image 302</a></li>
                                <li><a href="#">image 303</a></li>
                                <li><a href="#">image 304</a></li>
                                <li><a href="#">image 305</a></li>
                            </ul>
                            <ul class="list-unstyled">
                                <li><a href="#">image 306</a></li>
                                <li><a href="#">image 307</a></li>
                                <li><a href="#">image 308</a></li>
                                <li><a href="#">image 309</a></li>
                                <li><a href="#">image 310</a></li>
                            </ul>
                            <ul class="list-unstyled">
                                <li><a href="#">image 311</a></li>
                                <li><a href="#">image 312</a></li>
                                <li><a href="#">image 313</a></li>
                                <li><a href="#">image 314</a></li>
                                <li><a href="#">image 315</a></li>
                            </ul>
                        </div>
                    </div>
                </li>
                <li><a href="/home/myarchive.php"><i class="fa fa-cubes"></i> 我的文章</a></li>
                <li><a href="/home/contact.php"><i class="fa fa-envelope"></i> 发表文章</a></li>
            </ul>
            <!-- <ul class="list-inline navbar-right top-social">
                <li><a href="#"><i class="fa fa-facebook"></i></a></li>
                <li><a href="#"><i class="fa fa-twitter"></i></a></li>
                <li><a href="#"><i class="fa fa-pinterest"></i></a></li>
                <li><a href="#"><i class="fa fa-google-plus-square"></i></a></li>
                <li><a href="#"><i class="fa fa-youtube"></i></a></li>
            </ul> -->
        </div>
    </nav>
</header>